/**
 * 
 */
package com.gr.staffpm.widget.calendar.model;

import java.util.Locale;

import org.apache.wicket.model.IModel;


/**
 * @author Graham Rhodes 7 Jan 2011 19:53:45
 */
public class MonthLabelModel implements IModel<String> {

    private static final long serialVersionUID = 1L;
    private final java.util.Calendar cal = java.util.Calendar.getInstance();

    public MonthLabelModel(java.util.Calendar calendar) {
        this.cal.setTime(calendar.getTime());
    }

    /* (non-Javadoc)
     * @see org.apache.wicket.model.IDetachable#detach()
     */
    @Override
    public void detach() {
    }

    /* (non-Javadoc)
     * @see org.apache.wicket.model.IModel#getObject()
     */
    @Override
    public String getObject() {
        return cal.getDisplayName(java.util.Calendar.MONTH, java.util.Calendar.LONG, Locale.getDefault()) + " " + cal.get(java.util.Calendar.YEAR);
    }

    /* (non-Javadoc)
     * @see org.apache.wicket.model.IModel#setObject(java.lang.Object)
     */
    @Override
    public void setObject(String object) {

    }

}
